home *** CD-ROM | disk | FTP | other *** search
/ Core Concepts in Art 2 / Core Concepts in Art (Frames of Reference)(The McGraw-Hill Companies)(2004).iso / mac / media / create.swf / scripts / frame_1 / DoAction.as < prev   
Text File  |  2003-11-06  |  3KB  |  116 lines

  1. function findFilePath(theChap, theQuest, theTarget)
  2. {
  3.    if(theChap < 10)
  4.    {
  5.       if(theQuest < 10)
  6.       {
  7.          loadVariables("txtFiles/Ch0" + theChap + "-0" + theQuest + ".txt",theTarget);
  8.       }
  9.       else
  10.       {
  11.          loadVariables("txtFiles/Ch0" + theChap + "-" + theQuest + ".txt",theTarget);
  12.       }
  13.    }
  14.    else if(theQuest < 10)
  15.    {
  16.       loadVariables("txtFiles/Ch" + theChap + "-0" + theQuest + ".txt",theTarget);
  17.    }
  18.    else
  19.    {
  20.       loadVariables("txtFiles/Ch" + theChap + "-" + theQuest + ".txt",theTarget);
  21.    }
  22. }
  23. function findUserTxt(theChap, theQuest, theTarget)
  24. {
  25.    if(theChap < 10)
  26.    {
  27.       if(theQuest < 10)
  28.       {
  29.          loadVariables(_root.filePath + "Ch0" + theChap + "-0" + theQuest + ".txt",theTarget);
  30.       }
  31.       else
  32.       {
  33.          loadVariables(_root.filePath + "Ch0" + theChap + "-" + theQuest + ".txt",theTarget);
  34.       }
  35.    }
  36.    else if(theQuest < 10)
  37.    {
  38.       loadVariables(_root.filePath + "/Ch" + theChap + "-0" + theQuest + ".txt",theTarget);
  39.    }
  40.    else
  41.    {
  42.       loadVariables(_root.filePath + "/Ch" + theChap + "-" + theQuest + ".txt",theTarget);
  43.    }
  44. }
  45. function findStartChapter()
  46. {
  47.    i = 0;
  48.    while(i < _root.questionsWithImages.length)
  49.    {
  50.       if(_root.questionsWithImages[i] != undefined && _root.questionsWithImages[i].length != 0)
  51.       {
  52.          theChapter = i;
  53.          create_mc.doHighlight(i);
  54.          return undefined;
  55.       }
  56.       i++;
  57.    }
  58. }
  59. function createQuestionArray(whichChapter)
  60. {
  61.    j = 1;
  62.    while(j <= this["chaptArray" + whichChapter].questionNum)
  63.    {
  64.       if(this["chapt" + whichChapter] == undefined)
  65.       {
  66.          this["chapt" + whichChapter] = new Array();
  67.       }
  68.       this["chapt" + whichChapter].push(j);
  69.       j++;
  70.    }
  71.    _root.questionsWithImages.push(this["chapt" + whichChapter]);
  72.    if(_root.questionsWithImages.length == _root.howManyChapters + 1)
  73.    {
  74.       findStartChapter();
  75.       i = 0;
  76.       while(i < _root.questionsWithImages[theChapter].length)
  77.       {
  78.          duplicateMovieClip("create_mc.variableHolder_mc","vh" + i,16384 + (200 + i));
  79.          i++;
  80.       }
  81.       j = 0;
  82.       while(j < _root.howManyChapters)
  83.       {
  84.          duplicateMovieClip("create_mc.chapter_mc","chapt" + j,16384 + (300 + j));
  85.          create_mc["chapt" + j].highlight_mc._visible = 0;
  86.          if(j < 9)
  87.          {
  88.             create_mc["chapt" + j]._x = create_mc.chapter_mc._x + 12 * j;
  89.          }
  90.          else
  91.          {
  92.             create_mc["chapt" + j]._x = create_mc.chapter_mc._x - 64 + 20 * j;
  93.          }
  94.          var chapterColor = new Color(create_mc["chapt" + j].theChap);
  95.          chapterColor.setRGB(_root.restColor);
  96.          create_mc["chapt" + j].theNum = j + 1;
  97.          if(j < _root.dropChapters)
  98.          {
  99.             create_mc["chapt" + j].chap_btn._visible = 0;
  100.             create_mc["chapt" + j]._alpha = 30;
  101.          }
  102.          j++;
  103.       }
  104.       findStartChapter();
  105.       create_mc.variableHolder_mc.firstTime = 1;
  106.    }
  107. }
  108. function greyOutEmptyTitles(whatToCheck)
  109. {
  110.    if(_root.questionsWithImages[whatToCheck + 1].length == 0)
  111.    {
  112.       create_mc["chapt" + whatToCheck].chap_btn._visible = 0;
  113.       create_mc["chapt" + whatToCheck]._alpha = 30;
  114.    }
  115. }
  116.